﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Tesla.DataAccess.DataAccessLogic.Implementations;
using Tesla.Util.Utilities;
using Tesla.Service.DataContracts;
using Tesla.DataAccess.DataAccessLogic.Interfaces;
using Tesla.Business.BusinessLogic.Interfaces;
using System.Transactions;

namespace Tesla.Business.BusinessLogic.Implementations
{
    public class UserLoginBL : IUserLoginBL
    {
        public void ValidateUser(string userName, string password, ref bool? userExists)
        {
            
            try
            {
                using (ContextDA cDA = new ContextDA())
                {
                    IUserLoginDA idaUserLogin = cDA.CreateSpecializedDA(EntityMapper.USERLOGINDA) as IUserLoginDA;
                    idaUserLogin.ValidateUser(userName, password, ref userExists);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
